import VueRouter from 'vue-router'
//导入对应的路由组件
import Home from './components/tabbar/home.vue'
import Member from './components/tabbar/member.vue'
import Shopcar from './components/tabbar/shopcar.vue'
import Search from './components/tabbar/search.vue'
import NewsList from './components/news/newsList.vue'
import NewsInfo from './components/news/newsinfo.vue'
import BookList from './components/books/booklist.vue'
import BookInfo from './components/books/bookinfo.vue'
import GoodsList from './components/goods/goodslist.vue'
import GoodsInfo from './components/goods/goodsinfo.vue'
import GoodsDesc from './components/goods/goodsdesc.vue'
import GoodsComment from './components/goods/goodscomment.vue'

var router = new VueRouter({
    routes:[    //配置路由规则
        {path:'/',redirect:'/home'},
        {path:'/home',component:Home} ,
        {path:'/member',component:Member },
        {path:'/shopcar',component:Shopcar },
        {path:'/search',component:Search },
        {path:'/home/newsList',component:NewsList },
        {path:'/home/newsinfo/:title',component:NewsInfo },
        {path:'/home/booklist',component:BookList },
        {path:'/home/bookinfo/:sub1',component:BookInfo },
        {path:'/home/goodslist',component:GoodsList },
        {path:'/home/goodsinfo/:title',component:GoodsInfo,name:'goodsinfo'},
        {path:'/home/goodsdesc/:title',component:GoodsDesc,name:'goodsdesc' },
        {path:'/home/goodscomment/:title',component:GoodsComment,name:'goodscomment' },
    ],
    linkActiveClass:'mui-active',     //覆盖默认的高亮显示的类
})

export default router